﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


class returnsBitAtPositionP
{
    static void Main(string[] args)
    {
        Console.WriteLine("Enter Number");
        int number = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter position V:");
        int v = Convert.ToInt32(Console.ReadLine());
        int position = (v - 1);
        int mask = (1 << position);
        int nAndMask = (number & mask);
        int bit = nAndMask >> position;
        bool isOne = (bit == 1);
        Console.WriteLine(isOne);
    }
}
